package com.ycg.vue.modules.system.mapper;

import com.ycg.vue.Annotation.AutoInsert;
import com.ycg.vue.Enum.AutoInsertType;
import com.ycg.vue.modules.system.Entity.BillTypeEntity;
import com.ycg.vue.modules.system.Dto.BillTypeDTO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @Description
 * @Author jink
 * @Date 2024/6/13
 */
@Mapper
public interface BillMapper {

    List<BillTypeEntity> TypeList(@Param("dto") BillTypeDTO dto);

    @AutoInsert(value = AutoInsertType.INSERT)
    void InsertNewType(@Param("dto") BillTypeEntity dto);

    @Select("SELECT * FROM bill_type WHERE id = #{id}")
    BillTypeEntity selectById(@Param("id") String id);

    @AutoInsert(value = AutoInsertType.UPDATE)
    void updateType(@Param("bill") BillTypeDTO bill);

    @Delete("DELETE FROM bill_type WHERE id = #{id}")
    void deleteById(@Param("id") String id);

    List<Map<String, Object>> getBillList(@Param("id") String id,@Param("begin") String begin,@Param("end") String end);

    Double situation(@Param("id") String id,@Param("begin") String begin,@Param("end") String end,@Param("type") Integer type);
}
